<%@ page import="com.servlet.jsp.Person" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: WuLiangHang
  Date: 2021/9/14
  Time: 16:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //3.在对应的JSP页面里面拆箱
    //如果直接访问该JSP页面，people为null
    List<Person> people = (List<Person>) request.getAttribute("people");
%>
<html>
<head>
    <title>人员列表</title>
    <!-- Bootstrap core CSS -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.14/dist/css/bootstrap.min.css"
          rel="stylesheet">
</head>
<body>
<div class="table-responsive">
    <table class="table table-striped">
        <thead>
        <tr>
            <th>人员ID</th>
            <th>人员名称</th>
            <th>人员年龄</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <%
            for (int i = 0; i < people.size(); i++) {
                Person person = people.get(i);
        %>
        <tr>
            <td><%= person.getId()%>
            </td>
            <td><%= person.getName()%></td>
            <td><%= person.getAge()%></td>
            <td>
                <button class="btn btn-info" data-toggle="modal" data-target="#productModal">修改</button>
                <button class="btn btn-danger">删除</button>
            </td>
        </tr>
        <%
            }
        %>

        </tbody>
    </table>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
        crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.14/dist/js/bootstrap.min.js"></script>
</body>
</html>
